<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      input {
        border-color: 1px solid #ccc;
        color: #ccc;
        /* border: none; */
        outline: none;
      }
    </style>
  </head>
  <body>
    <div class="box">
      <input type="text" value="邮箱/ID/手机号" />
    </div>
    <script>
      //1.事件源
      var int = document.querySelector('input');
      //2.事件类型
      int.onfocus = function () {
        //3.事件代码
        this.value = '';
        int.style.border = '1px solid pink';
      };
      int.onblur = function () {
        this.value = '邮箱/ID/手机号';
        int.style = '';
      };
    </script>
  </body>
</html>
